The sixth parameter passed to the SndStartFilePlay function is a pointer to an audio selection record, which allows you to specify that only part of the sound be played. If that parameter has a value different from NIL , then SndStartFilePlay plays only a specified selection of the entire sound. You indicate which part of the entire sound to play by giving two offsets from the beginning of the sound, a time at which to start the selection and a time at which to end the selection. Currently, both time offsets must be specified in seconds.
Here is the structure of an audio selection record:
TYPE AudioSelection =
PACKED RECORD
unitType: LongInt; {type of time unit}
selStart: Fixed; {starting point of selection}
selEnd: Fixed; {ending point of selection}
END;
To play a selection, you should specify in the selStart and selEnd fields the starting and ending point in seconds of the sound to play. Also, you must set the unitType field to the constant unitTypeSeconds .
If you wish to play an entire sound, you can simply pass NIL to the SndStartFilePlay function. Alternatively, you can set the unitType field to the constant unitTypeNoSelection , in which case the values in the selStart and selEnd fields are ignored.
| Previous | Chapter contents | Chapter top | Section top | Next |